home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / demo / medmfc.zip / MULTIPAD.CPP < prev    next >
C/C++ Source or Header  |  1994-06-27  |  2KB  |  59 lines

  1. // multipad.cpp : Defines the class behaviors for the Multipad application.
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and Microsoft
  9. // QuickHelp and/or WinHelp documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #include "stdafx.h"
  14. #include "magmaed.hpp"
  15. #include "mainfrm.h"
  16. #include "multipad.h"
  17.  
  18. CMultiPadApp NEAR theApp;
  19.  
  20. BEGIN_MESSAGE_MAP(CMultiPadApp, CWinApp)
  21.     //{{AFX_MSG_MAP(CMultiPadApp)
  22.     ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  23.     //}}AFX_MSG_MAP
  24.     ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)     // file commands...
  25.     ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  26.     ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
  27. END_MESSAGE_MAP()
  28.  
  29. BOOL CMultiPadApp::InitInstance()
  30. {
  31.     SetDialogBkColor();
  32.     LoadStdProfileSettings();
  33.     AddDocTemplate(new CMultiDocTemplate(IDR_TEXTTYPE,
  34.         RUNTIME_CLASS(CPadDoc), RUNTIME_CLASS(CMDIChildWnd),
  35.         RUNTIME_CLASS(CMagmaEditView)));
  36.     m_pMainWnd = new CMainFrame;
  37.     ((CFrameWnd*)m_pMainWnd)->LoadFrame(IDR_MAINFRAME);
  38.     m_pMainWnd->ShowWindow(m_nCmdShow);
  39.  
  40.     // enable file manager drag/drop and DDE Execute open
  41.     m_pMainWnd->DragAcceptFiles();
  42.     EnableShellOpen();
  43.     RegisterShellFileTypes();
  44.  
  45.     if (m_lpCmdLine[0] == 0)
  46.         OnFileNew();
  47.     else
  48.         OpenDocumentFile(m_lpCmdLine);
  49.     return TRUE;
  50. }
  51.  
  52. void CMultiPadApp::OnAppAbout()
  53. {
  54.   CDialog(IDD_ABOUTBOX).DoModal();
  55. }
  56.  
  57. /////////////////////////////////////////////////////////////////////////////
  58.  
  59.